/**
 * 树卡组件
 * @param value 
 */
import { Component } from "react";

import "./index.less";

import Icon from 'bee-icon';
import 'bee-icon/build/Icon.css';

import Tree from './components/tree.jsx'

import { vendorsSetStorage, vendorsGetStorage, vendorsDanger, vendorsFmtDate, vendorsGetUrlParam } from 'utils/config.js';

class TreeCard extends Component {
    constructor(props) {
        super(props)
        this.state = {

        }
        this.output = {}
    }

    componentDidMount() {
        document.getElementById('tree-card').style.height = `${document.body.clientHeight - 68}px`
        this.output = {
            ...this.output,
            ...this.treeRef.output
        }
    }
    render() {
        let { cardComponents } = this.props;
        console.log(this.props)
        return (
            <div className='tree-card' id='tree-card'>
                <div className='tree-area' >
                    <Tree {...this.props} ref={el => this.treeRef = el}></Tree>
                </div>
                <div className='card-area'>
                    {
                        this.props.cardComponents
                    }
                </div>
            </div>
        )
    }
    componentWillUnmount() {

    }
}

function YGCCreateTreeCard(params) {
    return <TreeCard
        ref={child => this.treeCard = child}
        {...params}
    />
}

export default YGCCreateTreeCard;